package com.telit.android.controller;

import com.telit.android.service.impl.AppVersionService;
import com.telit.common.entity.DataReturn;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


/**
 * @Auther amy
 * @Describe
 */
@RestController
@Api(tags = "app端更新")
@RequestMapping("app_version")
public class AppVersionController {

    @Autowired
    private AppVersionService appVersionService;

    @ApiOperation(value = "查询app最新版本,type =1(护林员)")
    @GetMapping(value = "/latestVersion", produces = "application/json;charset=UTF-8")
    public DataReturn getLatestVersion(@RequestParam(defaultValue = "1") String type) {
        return DataReturn.ok(appVersionService.selectLatestVersion(type));
    }

}
